<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
<link rel="stylesheet" href="css/public.css">
<header>
    <ul class="log">
        <li class="top_li">
            <a href="index.jsp">
                <img src="images/logB.png" width="300px">
            </a>
        </li>
        <li class="ul_last">
            <ul class="blacks">
                <a href="index.jsp">
                    <li class="sett1">首页</li>
                </a>
                <a href="brand.jsp">
                    <li class="sett3">品牌馆</li>
                </a>
                <a href="center.jsp" target="_blank">
                    <li class="sett5">个人中心</li>
                </a>
            </ul>
        </li>
        <li class="hunt">
                <input type="text" class="input_ss" name="condition">
                <input type="submit" value="搜索" class="a_ss">
        </li>
    </ul>
</header>
<script src="js/jquery.min.js"></script>
<script>
    $(document).ready(function() {
        $(".a_ss").click(function () {
            const search = $(".input_ss").val();
            window.location.href = "search.jsp?searchName=" + search;
        });
        let user = localStorage.getItem("userJson");
        user = eval('(' + user + ')');
        const blacks = $(".blacks");
        let htmlStore = "";
        if (user.userStore != 0) {
            htmlStore = "<a href='store.jsp?storeId="+user.userStore+"' target='_blank'><li class='sett5'>商店</li></a>";
            blacks.append(htmlStore);
        }
    });
</script>